import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jun Xu
 * Date：2024/1/11
 * Time: 21:26
 */
public class javatest {



    /*public static void main(String[] args) {
        int[] arr = {9, 5, 2, 7};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void bubbleSort(int[] arr){
        for(int i = 0; i < arr.length - 1;i++){
            for(int j = 1; j < arr.length - i;j++){
                if(arr[j - 1] > arr[j]){
                    int tmp = arr[j-1];
                    arr[j-1] = arr[j];
                    arr[j] = tmp;
                }
            }
        }
    }*/

    /*public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        System.out.println(binarySearch(arr, 6));
    }
    public static int binarySearch(int[] arr,int data){
        int left = 0;
        int right = arr.length - 1;
        while(left <= right){
            int mid = (left + right)/2;
            if(arr[mid] < data){
                left = mid + 1;
            }else if(arr[mid] > data){
                right = mid - 1;
            }else {
                return mid;
            }
        }
        return -1;
    }*/

    /*public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        System.out.println(avg(arr));
    }
    public static double avg(int[] arr){
        int sum = 0;
        for (int x:arr)
        {
            sum += x;
        }
        return (double)sum/(double)arr.length;

    }*/
}
